package cn.lyn4ever.common;

public class R {
    private String code;
    private String msg;
    private Object data;

    public static R sucess(String msg, Object object) {
        R r = new R();
        r.setCode("200");
        r.setMsg(msg);
        r.setData(object);
        return r;
    }

    public static R sucess(String msg) {
        R r = new R();
        r.setCode("200");
        r.setMsg(msg);
        return r;
    }

    public static R fail(String msg, Object object) {
        R r = new R();
        r.setCode("100");
        r.setMsg(msg);
        r.setData(object);
        return r;
    }

    public static R fail(String msg) {
        R r = new R();
        r.setCode("100");
        r.setMsg(msg);
        return r;
    }

    public static R sucess() {
        R r = new R();
        r.setCode("200");
        r.setMsg("操作成功");
        return r;
    }

    public static R fail() {
        R r = new R();
        r.setCode("100");
        r.setMsg("操作失败");
        return r;
    }


    public String getCode() {
        return code;
    }

    public R setCode(String code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public R setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getData() {
        return data;
    }

    public R setData(Object data) {
        this.data = data;
        return this;
    }


}
